public class Complexoperation {
    MyComplex ComplexAdd(MyComplex a,MyComplex b){
        MyComplex c = new MyComplex(a.RealPart+b.RealPart,a.ImagePart+b.ImagePart);
        return c;
    }

    MyComplex ComplexSub(MyComplex b,MyComplex a){
        MyComplex c = new MyComplex(b.RealPart-a.RealPart,b.ImagePart-a.ImagePart);
        return c;
    }

    MyComplex ComplexMulti(MyComplex a,MyComplex b){
        MyComplex c = new MyComplex(a.RealPart*b.RealPart-a.ImagePart*b.ImagePart,a.RealPart*b.ImagePart+a.ImagePart*b.RealPart);
        return c;
    }

    MyComplex ComplexDiv(MyComplex b,MyComplex a){
        MyComplex c = new MyComplex(
                (a.RealPart*b.RealPart+a.ImagePart*b.ImagePart)/(a.RealPart*a.RealPart+a.ImagePart*a.ImagePart),
                (a.RealPart*b.ImagePart-a.ImagePart*b.RealPart)/(a.RealPart*a.RealPart+a.ImagePart*a.ImagePart));
        return c;
    }
}
